package com.zenithmind.exam.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 答题提交DTO
 * 
 * @author ZenithMind
 * @since 2024-07-01
 */
@Data
@Schema(name = "答题提交DTO", description = "答题提交的数据传输对象")
public class AnswerSubmitDTO {

    /**
     * 考试记录ID
     */
    @NotBlank(message = "考试记录ID不能为空")
    @Schema(description = "考试记录ID")
    private String examRecordId;

    /**
     * 答题列表
     */
    @NotEmpty(message = "答题列表不能为空")
    @Schema(description = "答题列表")
    private List<QuestionAnswerDTO> answers;

    /**
     * 题目答案DTO
     */
    @Data
    @Schema(name = "题目答案DTO", description = "题目答案信息")
    public static class QuestionAnswerDTO {
        
        /**
         * 题目ID
         */
        @NotBlank(message = "题目ID不能为空")
        @Schema(description = "题目ID")
        private String questionId;

        /**
         * 用户答案
         */
        @Schema(description = "用户答案")
        private List<String> userAnswer;

        /**
         * 答题用时（秒）
         */
        @Schema(description = "答题用时（秒）")
        private Integer timeSpent;
    }
}
